import pymysql
conn = pymysql.connect(host='localhost',
                       user='root',
                       password='123456',
                       db='student',
                       port=3306,
                       charset='gbk')
cur = conn.cursor()
cur.execute("select s_name,s_id from student where s_sex = '男'")
ans=cur.fetchall()
print(ans)